UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RZ/L5vesKGs6HFwD89CI6YAXFOWKO6no2VLZ44V3fhU='
WHERE
key_id = '4074a4ddab53a8a22894c9f0b8d43b12927e2465c0e414125d06a5879cd755a3'
AND (
token = 'RZ/L5vesKGs6HFwD89CI6YAXFOWKO6no2VLZ44V3fhU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)