UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cjdPa4VmpyOcId5SbQgs3dW94YfBYXjw3PtQgx5qEsU=' 
WHERE 
  key_id = '9c3c32ebcbc8140a4a02651a060fd313e8d729119545fa7c16ff7ee413173f93' 
  AND (
    token = 'cjdPa4VmpyOcId5SbQgs3dW94YfBYXjw3PtQgx5qEsU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044