UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3f8h6d0iaMommKF1ANDZhPH4YN9w7lNaJNaV9e+a6OI=' 
WHERE 
  key_id = 'ff43b82caab241a4e8e24863e79ee35326321afbc81009bcb7941a99687b0153' 
  AND (
    token = '3f8h6d0iaMommKF1ANDZhPH4YN9w7lNaJNaV9e+a6OI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037