UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'q+R2kOcTLuO9xpzOSHrfPfi0wSHE63AJhZPZGrdvyNA=' 
WHERE 
  key_id = '33237f42702fcdc755b824bbd291da1ace7f6073f541cfe34aae8c4841997b02' 
  AND (
    token = 'q+R2kOcTLuO9xpzOSHrfPfi0wSHE63AJhZPZGrdvyNA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030