UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yIaSVuXqWkLEeVVAP9914Yzz78ITvdxhUou8kbKXUuk=' 
WHERE 
  key_id = '5c7e1528d7286326b2cd10beb26a9f26706a19b167b0528efec111ccef2dc8b3' 
  AND (
    token = 'yIaSVuXqWkLEeVVAP9914Yzz78ITvdxhUou8kbKXUuk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024