UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sjnk8/x1PNnKZ075H3zIEXjku/4gpRNvHmmO8Lp4DE0=' 
WHERE 
  key_id = 'cc81779b4482bead6ffc6e3206b71ac4bba1ced0db19a2137c41556698b34248' 
  AND (
    token = 'sjnk8/x1PNnKZ075H3zIEXjku/4gpRNvHmmO8Lp4DE0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017