UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '29x8QV30luIpxOQzPbChSVbLSNgFYFE592mJKAPKUWU=' 
WHERE 
  key_id = '26107c035fe288b0dfdd2190c2cd3a472b3a2fadf50171f84774539a018e86a5' 
  AND (
    token = '29x8QV30luIpxOQzPbChSVbLSNgFYFE592mJKAPKUWU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033