UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2bTHMs0IwWIqHivNA/B2rvf0j1wxYUeui9jK2ckjg+c=' 
WHERE 
  key_id = '86592d638a71411fafde9d773ee1a18474d8b39e6dbc5d480b6870bdbedc28bc' 
  AND (
    token = '2bTHMs0IwWIqHivNA/B2rvf0j1wxYUeui9jK2ckjg+c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032