UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ipOUKBsNOgUIpioDOd02PMlNnwQ7M+NO6NI0gB4H0do=' 
WHERE 
  key_id = '1eeaa3a66444e53276998a981118968b1ca155237967e8509235880d6264aad8' 
  AND (
    token = 'ipOUKBsNOgUIpioDOd02PMlNnwQ7M+NO6NI0gB4H0do=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031