UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Lerr6TgxmPKVC6iWn9dRre029YqXx51Ruzpe7yGU+T0='
WHERE
key_id = '5279e1ffd40a33033a1a839679daf2bf8501c505b6cba3634e063230845d651f'
AND (
token = 'Lerr6TgxmPKVC6iWn9dRre029YqXx51Ruzpe7yGU+T0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)