UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KZA23MxVUJRx+2PeD6K9cK12Aa0WYSOX9VMsVLTrgdc='
WHERE
key_id = '67b54e365f8680eea0ee10fca5f236a35a7bafc547babf2c982855221462ec1b'
AND (
token = 'KZA23MxVUJRx+2PeD6K9cK12Aa0WYSOX9VMsVLTrgdc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)