UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4JjbwDI+eP49vOLRHSD6ek/6d0oJtHVrRiKn5M4+L6g=' 
WHERE 
  key_id = '93df922f456faf8ecbef3b870257f9c67407bdd480b2a71488ad7193dce11627' 
  AND (
    token = '4JjbwDI+eP49vOLRHSD6ek/6d0oJtHVrRiKn5M4+L6g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021