UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'W2x5OG2krSuM5lRdPHoqLzL3UN1Eh1isGkjNTBuW7Ac='
WHERE
key_id = '072af098a6cdd8eaf49890f921ef4c2ff76f21907eeb3e17237cb59468fdc3b5'
AND (
token = 'W2x5OG2krSuM5lRdPHoqLzL3UN1Eh1isGkjNTBuW7Ac='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)