UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OXOcodNRNVF+tcBuqq1c2Q5vu/WkyRT4gIrhqc3cbLs='
WHERE
key_id = 'dd69c19f71d9b469aae523cc2fd50ad990299d17a9b24f3f1772cebf759af520'
AND (
token = 'OXOcodNRNVF+tcBuqq1c2Q5vu/WkyRT4gIrhqc3cbLs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)