UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UfHxXXYIfYmuLlTuwxAiVm6nCw8gTX7IR46eP74NMPw=' 
WHERE 
  key_id = '6e697e2b319a4045f1b99761d40bf9ac0103fbaa75461db3c65b77b5ee5ad101' 
  AND (
    token = 'UfHxXXYIfYmuLlTuwxAiVm6nCw8gTX7IR46eP74NMPw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017