UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PWyp1978l5ixCcJ4rrOOsE2wsHjJTSnQolkRrF/qcF4='
WHERE
key_id = '23db78bb7093b400dced8c25352b4b9acabaaa10e55bf67061b316126ce28037'
AND (
token = 'PWyp1978l5ixCcJ4rrOOsE2wsHjJTSnQolkRrF/qcF4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)