UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ijrHdyT/X1J01Oqtm7EGaS+uUOLZRSXlPPjk30ZcMNI='
WHERE
key_id = 'c4518cb28e0b7de77b0778bd24e000f70405c8a67da003f1840cd8ea5c65f16d'
AND (
token = 'ijrHdyT/X1J01Oqtm7EGaS+uUOLZRSXlPPjk30ZcMNI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)