UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EeN7X44AMAo/g2XBuTNFmQIZ7D4uszqXtwjyhEIswD0='
WHERE
key_id = '09a91a9cd9d1f571c39e97f824bf7efd76946e8d63cc30bad1ebb071622e9cca'
AND (
token = 'EeN7X44AMAo/g2XBuTNFmQIZ7D4uszqXtwjyhEIswD0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)