UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'L1FbQKqQxYPZpo7BJhs0q+M7+GhX+NgpiBlppkhtjgI=' 
WHERE 
  key_id = '0218d35577dbe705bad38d06a005dae2cb506141d8309a7613d09f71192f9d45' 
  AND (
    token = 'L1FbQKqQxYPZpo7BJhs0q+M7+GhX+NgpiBlppkhtjgI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030