UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fNWsIWenf+IPdGUa02aCRZ9t1wRQFCCpdYL5I8Ke5xw='
WHERE
key_id = '259a43ed47e268db87262274ab55138f4f6f8247ef63b091d380a96ac9efd875'
AND (
token = 'fNWsIWenf+IPdGUa02aCRZ9t1wRQFCCpdYL5I8Ke5xw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)