UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bLUG7XZFt+hgMX8DmiQl5mA1ydt3/QC0GbS2i6J/iO8=' 
WHERE 
  key_id = '4b3dc7461392d2cffde5999c9a963dc2f0c4f96ce6bb1bc3ddab7b8ff01e882b' 
  AND (
    token = 'bLUG7XZFt+hgMX8DmiQl5mA1ydt3/QC0GbS2i6J/iO8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032