UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LgweZ+pAOosWXRXc5VGUSw1cI/NcZmgOkYYQbYRyByw=' 
WHERE 
  key_id = 'f91288bfceae44c692dea59b7c227ad1d48d5e668dc511aa5f35ca7f27849978' 
  AND (
    token = 'LgweZ+pAOosWXRXc5VGUSw1cI/NcZmgOkYYQbYRyByw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028