UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qXLUIS/Dt7lM7ze6rV2Atfdfa0lqtZv/SRDh88wAkSk='
WHERE
key_id = '4551f4a7352b19d575b4623bb6431409d30caee50491569e5acd29234cc05249'
AND (
token = 'qXLUIS/Dt7lM7ze6rV2Atfdfa0lqtZv/SRDh88wAkSk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)