UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NWGmqw4l41JXCn+3/8MQM+e5JT7tolKp5T8JCxcMEpk=' 
WHERE 
  key_id = '9435d698f08c0a99bbfa8a1ba71baf8bd2ac772639058ddf00bf5fcb1c6f6c5b' 
  AND (
    token = 'NWGmqw4l41JXCn+3/8MQM+e5JT7tolKp5T8JCxcMEpk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052