UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RodR4PJKAQyenHvMVi3MAfmfuvGgJxtWexQHI+Mb070=' 
WHERE 
  key_id = '148ec0549fa45544545d71146cdb3e1066715ed71a798391bbf9f3b85106c1ed' 
  AND (
    token = 'RodR4PJKAQyenHvMVi3MAfmfuvGgJxtWexQHI+Mb070=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036