UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'U2GqnGtUOEs8V2C2eY9/mVkrCccGBG9x5gMOOHLahSI='
WHERE
key_id = '5bb004755a031981d03c147a1375b914ce3f105e52651651ece7ede66a57adcd'
AND (
token = 'U2GqnGtUOEs8V2C2eY9/mVkrCccGBG9x5gMOOHLahSI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)