UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 's2CsSDtTmD93eBTPDEcvUkpM/zNmADTziverci6i6xE='
WHERE
key_id = 'ee07cd8e63897818baf0ec0a60ab8a4dd23fb227b0d029407f2b97ba48bc5c64'
AND (
token = 's2CsSDtTmD93eBTPDEcvUkpM/zNmADTziverci6i6xE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)