UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7R7Mto+1MQ1XpI7qQQqexShAvR2DOA9zAujgWkE088M=' 
WHERE 
  key_id = '90f66a166459747ad6e13ca7f6510980cd5ee63e7b0ec302f2fde92ec74de15d' 
  AND (
    token = '7R7Mto+1MQ1XpI7qQQqexShAvR2DOA9zAujgWkE088M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034