UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pBXCiHz8+3gs8659Opc8qt7N2w9DoDz/v7iKdIGCgWM='
WHERE
key_id = '57b4be8d690070db6ebe63ded79bc779844df70cb1f9566b6386761e10166fc3'
AND (
token = 'pBXCiHz8+3gs8659Opc8qt7N2w9DoDz/v7iKdIGCgWM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)