UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BstsKdpDZzCEO/xRG6M7JCZlHG2wmI2r4v22fu1BusQ='
WHERE
key_id = 'c53245b5d62590b8b6fba9056801403e25800ff84c96c9fb8af3c79a088ca1a8'
AND (
token = 'BstsKdpDZzCEO/xRG6M7JCZlHG2wmI2r4v22fu1BusQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)