UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PhP9l0WH60728no8ACy6BdaPaNl0H0dkDqgupA9neLE=' 
WHERE 
  key_id = '19ca0f9227d380cb71e3ce7a65900d7658e76ed8acb5644bcfc62c57081b90d2' 
  AND (
    token = 'PhP9l0WH60728no8ACy6BdaPaNl0H0dkDqgupA9neLE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048