UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EIdRbpcsut+MgDakZJOWzn9mZ9ykH3RwYp32ruEb27U=' 
WHERE 
  key_id = '071d8bfe7e1e18b98cd1358cfbe4915f651b2ce6952da007c773f823b22a6077' 
  AND (
    token = 'EIdRbpcsut+MgDakZJOWzn9mZ9ykH3RwYp32ruEb27U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016