UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IwIyDg4dcwWXd+k8kxPUclq4ay5T1c0OydVtqxb6Tgs=' 
WHERE 
  key_id = '6d424b09d64286b7e2d9082ba04903343ccfe2f05b8488926994b38f213053ce' 
  AND (
    token = 'IwIyDg4dcwWXd+k8kxPUclq4ay5T1c0OydVtqxb6Tgs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020