UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fvGOu8nbfDHzcXpRVP9DzF0Ib5BRr7vrmDqZbbqxky4=' 
WHERE 
  key_id = '0772c516f374fe54bf280b55d7a174eb3b9271747ba7e923ddd60dd446cd7eb0' 
  AND (
    token = 'fvGOu8nbfDHzcXpRVP9DzF0Ib5BRr7vrmDqZbbqxky4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051