UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fanD+qngEdOd9Syl9XPhDxhQRMceSnWrQy0aEwqktE4='
WHERE
key_id = '636f8a7daf466c1d4e49a9b835585f74acaf6ffb8cb0002b4bfb16392788ebed'
AND (
token = 'fanD+qngEdOd9Syl9XPhDxhQRMceSnWrQy0aEwqktE4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)