UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xTFgOp3LhSbZDeyp6jL0qel9ieddswTNrx2vMgL9LEI=' 
WHERE 
  key_id = '0483621ac6f04c9e1c2a98174bcba37f2e33fa42f55ed60067e7314048b49fce' 
  AND (
    token = 'xTFgOp3LhSbZDeyp6jL0qel9ieddswTNrx2vMgL9LEI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025