UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RevR7kOj2XbQRIMzyM27RW3ePYwP+SSCWk22qliNGyw='
WHERE
key_id = '417c21f095305a3bb99b54c8768af654cfd0392858e300062a4b01bc14025924'
AND (
token = 'RevR7kOj2XbQRIMzyM27RW3ePYwP+SSCWk22qliNGyw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)