UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DZxaG1LhfnmBW2PNKUQGMv7ft3O9ueYnT1qZy2HrSvU=' 
WHERE 
  key_id = 'd38b1dbcd2e8974ba3b3c3ed0e3d9412dcf7b6b630f0d50b7f17a415703bb66c' 
  AND (
    token = 'DZxaG1LhfnmBW2PNKUQGMv7ft3O9ueYnT1qZy2HrSvU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040